﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGeExtents3d : IDisposable
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdGeExtents3d(IntPtr cPtr, bool cMemoryOwn)
		{
			this.swigCMemOwn = cMemoryOwn;
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdGeExtents3d obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdGeExtents3d()
		{
			this.Dispose();
		}

		public virtual void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdGeExtents3d(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
		}

		public OdGeExtents3d() : this(GlobalsPINVOKE.new_OdGeExtents3d__SWIG_0(), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeExtents3d(OdGePoint3d min, OdGePoint3d max) : this(GlobalsPINVOKE.new_OdGeExtents3d__SWIG_1(OdGePoint3d.getCPtr(min), OdGePoint3d.getCPtr(max)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGePoint3d minPoint()
		{
			OdGePoint3d result = new OdGePoint3d(GlobalsPINVOKE.OdGeExtents3d_minPoint(this.swigCPtr), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGePoint3d maxPoint()
		{
			OdGePoint3d result = new OdGePoint3d(GlobalsPINVOKE.OdGeExtents3d_maxPoint(this.swigCPtr), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void set(OdGePoint3d min, OdGePoint3d max)
		{
			GlobalsPINVOKE.OdGeExtents3d_set(this.swigCPtr, OdGePoint3d.getCPtr(min), OdGePoint3d.getCPtr(max));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void comparingSet(OdGePoint3d pt1, OdGePoint3d pt2)
		{
			GlobalsPINVOKE.OdGeExtents3d_comparingSet(this.swigCPtr, OdGePoint3d.getCPtr(pt1), OdGePoint3d.getCPtr(pt2));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void addPoint(OdGePoint3d point)
		{
			GlobalsPINVOKE.OdGeExtents3d_addPoint(this.swigCPtr, OdGePoint3d.getCPtr(point));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void addExt(OdGeExtents3d extents)
		{
			GlobalsPINVOKE.OdGeExtents3d_addExt(this.swigCPtr, OdGeExtents3d.getCPtr(extents));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public bool isValidExtents()
		{
			bool result = GlobalsPINVOKE.OdGeExtents3d_isValidExtents(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void expandBy(OdGeVector3d vect)
		{
			GlobalsPINVOKE.OdGeExtents3d_expandBy(this.swigCPtr, OdGeVector3d.getCPtr(vect));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void transformBy(OdGeMatrix3d xfm)
		{
			GlobalsPINVOKE.OdGeExtents3d_transformBy(this.swigCPtr, OdGeMatrix3d.getCPtr(xfm));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public bool contains(OdGePoint3d point, OdGeTol tol)
		{
			bool result = GlobalsPINVOKE.OdGeExtents3d_contains__SWIG_0(this.swigCPtr, OdGePoint3d.getCPtr(point), OdGeTol.getCPtr(tol));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool contains(OdGePoint3d point)
		{
			bool result = GlobalsPINVOKE.OdGeExtents3d_contains__SWIG_1(this.swigCPtr, OdGePoint3d.getCPtr(point));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool contains(OdGeExtents3d extents, OdGeTol tol)
		{
			bool result = GlobalsPINVOKE.OdGeExtents3d_contains__SWIG_2(this.swigCPtr, OdGeExtents3d.getCPtr(extents), OdGeTol.getCPtr(tol));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool contains(OdGeExtents3d extents)
		{
			bool result = GlobalsPINVOKE.OdGeExtents3d_contains__SWIG_3(this.swigCPtr, OdGeExtents3d.getCPtr(extents));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isDisjoint(OdGeExtents3d extents, OdGeTol tol)
		{
			bool result = GlobalsPINVOKE.OdGeExtents3d_isDisjoint__SWIG_0(this.swigCPtr, OdGeExtents3d.getCPtr(extents), OdGeTol.getCPtr(tol));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isDisjoint(OdGeExtents3d extents)
		{
			bool result = GlobalsPINVOKE.OdGeExtents3d_isDisjoint__SWIG_1(this.swigCPtr, OdGeExtents3d.getCPtr(extents));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeExtents3d.IntersectionStatus intersectWith(OdGeExtents3d extents, OdGeExtents3d pResult)
		{
			OdGeExtents3d.IntersectionStatus result = (OdGeExtents3d.IntersectionStatus)GlobalsPINVOKE.OdGeExtents3d_intersectWith__SWIG_0(this.swigCPtr, OdGeExtents3d.getCPtr(extents), OdGeExtents3d.getCPtr(pResult));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeExtents3d.IntersectionStatus intersectWith(OdGeExtents3d extents)
		{
			OdGeExtents3d.IntersectionStatus result = (OdGeExtents3d.IntersectionStatus)GlobalsPINVOKE.OdGeExtents3d_intersectWith__SWIG_1(this.swigCPtr, OdGeExtents3d.getCPtr(extents));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGePoint3d center()
		{
			OdGePoint3d result = new OdGePoint3d(GlobalsPINVOKE.OdGeExtents3d_center(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		private object locker = new object();

		private HandleRef swigCPtr;

		protected bool swigCMemOwn;

		public enum IntersectionStatus
		{
			kIntersectUnknown,
			kIntersectNot,
			kIntersectOpIn,
			kIntersectOpOut,
			kIntersectOk
		}
	}
}
